<% @assignments = Assignment.find_by_team(@team_id).select {|d| d[:date_sql].to_date > Time.now.to_date and d[:date_sql].to_date < (Time.now + 30.days).to_date} %>


<h3>Reminder Call List for Team: <%= Team.find(@team_id).name rescue nil %></h3>
<div id="message-black">
	Showing assignments upcoming for the next 30 days.
</div>

<div>
	<%= @assignments.length %> assignments found.
</div>

<div id="assignments-enclosure">
	<ul>
	<% @assignments.group_by(&:date_sql).sort.each do |d,itn,g,assign| %>
		<li>
		<div class="group-one"><%= d.to_date.strftime('%m/%d/%Y') %>	</div>
			<% itn.group_by(&:instance_type_name).each do |itn, g, assign| %>
				<div class="group-two"><%= itn %></div>
					<% g.group_by(&:group_name).each do |g, assign| %>
						<div class="group-three"><%= g %></div>
							<% assign.each do |a| %>
								<div class="group-four">
									<%= a.full_name_b %>
								</div>
							<% end %>
					<% end %>
			<% end %>	
    	</li>
	<% end %>
	</ul>
</div>

<div style="float:none; clear:both">

</div>

<div id="team-roster">
	<%= render :partial => "team_roster", :locals => {:team_id => @team_id} %>
</div>

